package com.itheima.Test;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.nio.channels.ClosedSelectorException;
//生成随机数
public class Demo {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        Class clazz = Class.forName("java.lang.Math");


        Constructor constructor = clazz.getDeclaredConstructor();
        
        constructor.setAccessible(true);
        Math obj = (Math) constructor.newInstance();

        int i = (int) (obj.random() * 50 + 1);
        System.out.println(i);


    }
}
